<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Assimp: Usage</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Assimp
   &#160;<span id="projectnumber">v3.0 (July 2012)</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Usage </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="access_cpp"></a>
Access by C++ class interface</h1>
<p>The assimp library can be accessed by both a class or flat function interface. The C++ class interface is the preferred way of interaction: you create an instance of class <a class="el" href="class_assimp_1_1_importer.html" title="CPP-API: The Importer class forms an C++ interface to the functionality of the Open Asset Import Libr...">Assimp::Importer</a>, maybe adjust some settings of it and then call <a class="el" href="class_assimp_1_1_importer.html#a174418ab41d5b8bc51a044895cb991e5" title="Reads the given file and returns its contents if successful.">Assimp::Importer::ReadFile()</a>. The class will read the files and process its data, handing back the imported data as a pointer to an <a class="el" href="structai_scene.html" title="The root structure of the imported data.">aiScene</a> to you. You can now extract the data you need from the file. The importer manages all the resources for itsself. If the importer is destroyed, all the data that was created/read by it will be destroyed, too. So the easiest way to use the Importer is to create an instance locally, use its results and then simply let it go out of scope.</p>
<p>C++ example: </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_importer_8hpp.html">assimp/Importer.hpp</a>&gt;</span>      <span class="comment">// C++ importer interface</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="scene_8h.html">assimp/scene.h</a>&gt;</span>           <span class="comment">// Output data structure</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="postprocess_8h.html" title="Definitions for import post processing steps.">assimp/postprocess.h</a>&gt;</span>     <span class="comment">// Post processing flags</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">bool</span> DoTheImportThing( <span class="keyword">const</span> std::string&amp; pFile)</div>
<div class="line">{</div>
<div class="line">  <span class="comment">// Create an instance of the Importer class</span></div>
<div class="line">  <a class="code" href="class_assimp_1_1_importer.html" title="CPP-API: The Importer class forms an C++ interface to the functionality of the Open Asset Import Libr...">Assimp::Importer</a> importer;</div>
<div class="line"></div>
<div class="line">  <span class="comment">// And have it read the given file with some example postprocessing</span></div>
<div class="line">  <span class="comment">// Usually - if speed is not the most important aspect for you - you&#39;ll </span></div>
<div class="line">  <span class="comment">// propably to request more postprocessing than we do in this example.</span></div>
<div class="line">  <span class="keyword">const</span> <a class="code" href="structai_scene.html" title="The root structure of the imported data.">aiScene</a>* scene = importer.<a class="code" href="class_assimp_1_1_importer.html#a174418ab41d5b8bc51a044895cb991e5" title="Reads the given file and returns its contents if successful.">ReadFile</a>( pFile, </div>
<div class="line">        <a class="code" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410a8857a0e30688127a82c7b8939958c6dc">aiProcess_CalcTangentSpace</a>       | </div>
<div class="line">        <a class="code" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410a9c3de834f0307f31fa2b1b6d05dd592b">aiProcess_Triangulate</a>            |</div>
<div class="line">        <a class="code" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410a444a6c9d8b63e6dc9e1e2e1edd3cbcd4">aiProcess_JoinIdenticalVertices</a>  |</div>
<div class="line">        <a class="code" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410ab4484f73635d633cd79973bac1431ed6">aiProcess_SortByPType</a>);</div>
<div class="line">  </div>
<div class="line">  <span class="comment">// If the import failed, report it</span></div>
<div class="line">  <span class="keywordflow">if</span>( !scene)</div>
<div class="line">  {</div>
<div class="line">    DoTheErrorLogging( importer.<a class="code" href="class_assimp_1_1_importer.html#a23bab5ba8cb9b6886c690a610766668b" title="Returns an error description of an error that occurred in ReadFile().">GetErrorString</a>());</div>
<div class="line">    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Now we can access the file&#39;s contents. </span></div>
<div class="line">  DoTheSceneProcessing( scene);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// We&#39;re done. Everything will be cleaned up by the importer destructor</span></div>
<div class="line">  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
</div><!-- fragment --><p>What exactly is read from the files and how you interpret it is described at the <a class="el" href="data.html">Data Structures</a> page.  The post processing steps that the assimp library can apply to the imported data are listed at <a class="el" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410" title="Defines the flags for all possible post processing steps.">aiPostProcessSteps</a>. See the pp Post proccessing page for more details.</p>
<p>Note that the <a class="el" href="structai_scene.html" title="The root structure of the imported data.">aiScene</a> data structure returned is declared 'const'. Yes, you can get rid of these 5 letters with a simple cast. Yes, you may do that. No, it's not recommended (and it's suicide in DLL builds if you try to use new or delete on any of the arrays in the scene).</p>
<h1><a class="anchor" id="access_c"></a>
Access by plain-c function interface</h1>
<p>The plain function interface is just as simple, but requires you to manually call the clean-up after you're done with the imported data. To start the import process, call <a class="el" href="cimport_8h.html#a09fe8ba0c8e91bf04b4c29556be53b6d" title="Reads the given file and returns its content.">aiImportFile()</a> with the filename in question and the desired postprocessing flags like above. If the call is successful, an <a class="el" href="structai_scene.html" title="The root structure of the imported data.">aiScene</a> pointer with the imported data is handed back to you. When you're done with the extraction of the data you're interested in, call <a class="el" href="cimport_8h.html#a00a8db599403d4972ce70d97b9219080" title="Releases all resources associated with the given import process.">aiReleaseImport()</a> on the imported scene to clean up all resources associated with the import.</p>
<p>C example: </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="cimport_8h.html">assimp/cimport.h</a>&gt;</span>        <span class="comment">// Plain-C interface</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="scene_8h.html">assimp/scene.h</a>&gt;</span>          <span class="comment">// Output data structure</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="postprocess_8h.html" title="Definitions for import post processing steps.">assimp/postprocess.h</a>&gt;</span>    <span class="comment">// Post processing flags</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">bool</span> DoTheImportThing( <span class="keyword">const</span> <span class="keywordtype">char</span>* pFile)</div>
<div class="line">{</div>
<div class="line">  <span class="comment">// Start the import on the given file with some example postprocessing</span></div>
<div class="line">  <span class="comment">// Usually - if speed is not the most important aspect for you - you&#39;ll t</span></div>
<div class="line">  <span class="comment">// probably to request more postprocessing than we do in this example.</span></div>
<div class="line">  <span class="keyword">const</span> <a class="code" href="structai_scene.html" title="The root structure of the imported data.">aiScene</a>* scene = <a class="code" href="cimport_8h.html#a09fe8ba0c8e91bf04b4c29556be53b6d" title="Reads the given file and returns its content.">aiImportFile</a>( pFile, </div>
<div class="line">    <a class="code" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410a8857a0e30688127a82c7b8939958c6dc">aiProcess_CalcTangentSpace</a>       | </div>
<div class="line">        <a class="code" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410a9c3de834f0307f31fa2b1b6d05dd592b">aiProcess_Triangulate</a>            |</div>
<div class="line">        <a class="code" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410a444a6c9d8b63e6dc9e1e2e1edd3cbcd4">aiProcess_JoinIdenticalVertices</a>  |</div>
<div class="line">        <a class="code" href="postprocess_8h.html#a64795260b95f5a4b3f3dc1be4f52e410ab4484f73635d633cd79973bac1431ed6">aiProcess_SortByPType</a>);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// If the import failed, report it</span></div>
<div class="line">  <span class="keywordflow">if</span>( !scene)</div>
<div class="line">  {</div>
<div class="line">    DoTheErrorLogging( <a class="code" href="cimport_8h.html#abe72551b74cc4bc3c49349ce3014bc9b" title="Returns the error text of the last failed import process.">aiGetErrorString</a>());</div>
<div class="line">    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Now we can access the file&#39;s contents</span></div>
<div class="line">  DoTheSceneProcessing( scene);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// We&#39;re done. Release all resources associated with this import</span></div>
<div class="line">  <a class="code" href="cimport_8h.html#a00a8db599403d4972ce70d97b9219080" title="Releases all resources associated with the given import process.">aiReleaseImport</a>( scene);</div>
<div class="line">  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="custom_io"></a>
Using custom IO logic with the C++ class interface</h1>
<p>The assimp library needs to access files internally. This of course applies to the file you want to read, but also to additional files in the same folder for certain file formats. By default, standard C/C++ IO logic is used to access these files. If your application works in a special environment where custom logic is needed to access the specified files, you have to supply custom implementations of IOStream and IOSystem. A shortened example might look like this:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_i_o_stream_8hpp.html">assimp/IOStream.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_i_o_system_8hpp.html">assimp/IOSystem.hpp</a>&gt;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// My own implementation of IOStream</span></div>
<div class="line"><span class="keyword">class </span>MyIOStream : <span class="keyword">public</span> <a class="code" href="class_assimp_1_1_i_o_stream.html" title="CPP-API: Class to handle file I/O for C++.">Assimp::IOStream</a></div>
<div class="line">{</div>
<div class="line">  <span class="keyword">friend</span> <span class="keyword">class </span>MyIOSystem;</div>
<div class="line"></div>
<div class="line"><span class="keyword">protected</span>:</div>
<div class="line">  <span class="comment">// Constructor protected for private usage by MyIOSystem</span></div>
<div class="line">  MyIOStream(<span class="keywordtype">void</span>);</div>
<div class="line"></div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line">  ~MyIOStream(<span class="keywordtype">void</span>);</div>
<div class="line">  <span class="keywordtype">size_t</span> <a class="code" href="class_assimp_1_1_i_o_stream.html#ae376f641020989d61863b9c6f55c7abf" title="Read from the file.">Read</a>( <span class="keywordtype">void</span>* pvBuffer, <span class="keywordtype">size_t</span> pSize, <span class="keywordtype">size_t</span> pCount) { ... }</div>
<div class="line">  <span class="keywordtype">size_t</span> <a class="code" href="class_assimp_1_1_i_o_stream.html#ad0ca4aae1b8c4d00db391ac3a4171f7b" title="Write to the file.">Write</a>( <span class="keyword">const</span> <span class="keywordtype">void</span>* pvBuffer, <span class="keywordtype">size_t</span> pSize, <span class="keywordtype">size_t</span> pCount) { ... }</div>
<div class="line">  aiReturn <a class="code" href="class_assimp_1_1_i_o_stream.html#a5ed0dddf418ab08cf3fc21f3f3032220" title="Set the read/write cursor of the file.">Seek</a>( <span class="keywordtype">size_t</span> pOffset, aiOrigin pOrigin) { ... }</div>
<div class="line">  <span class="keywordtype">size_t</span> <a class="code" href="class_assimp_1_1_i_o_stream.html#a316ac6cd16b5a493d1313f792c806194" title="Get the current position of the read/write cursor.">Tell</a>()<span class="keyword"> const </span>{ ... }</div>
<div class="line">  <span class="keywordtype">size_t</span> <a class="code" href="class_assimp_1_1_i_o_stream.html#aaa01183d197fb714f28d6c611b6fa058" title="Returns filesize Returns the filesize.">FileSize</a>()<span class="keyword"> const </span>{ ... }</div>
<div class="line">  <span class="keywordtype">void</span> <a class="code" href="class_assimp_1_1_i_o_stream.html#a7c19952446ece90924b246f087417899" title="Flush the contents of the file buffer (for writers) See fflush() for more details.">Flush</a> () { ... }</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">// Fisher Price - My First Filesystem</span></div>
<div class="line"><span class="keyword">class </span>MyIOSystem : <span class="keyword">public</span> <a class="code" href="class_assimp_1_1_i_o_system.html" title="CPP-API: Interface to the file system.">Assimp::IOSystem</a></div>
<div class="line">{</div>
<div class="line">  MyIOSystem() { ... }</div>
<div class="line">  ~MyIOSystem() { ... }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Check whether a specific file exists</span></div>
<div class="line">  <span class="keywordtype">bool</span> <a class="code" href="class_assimp_1_1_i_o_system.html#a7ae6cfaea4957408967463bfc3b84b27" title="For backward compatibility.">Exists</a>( <span class="keyword">const</span> std::string&amp; pFile)<span class="keyword"> const </span>{</div>
<div class="line">    .. </div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// Get the path delimiter character we&#39;d like to see</span></div>
<div class="line">  <span class="keywordtype">char</span> GetOsSeparator()<span class="keyword"> const </span>{ </div>
<div class="line">    <span class="keywordflow">return</span> <span class="charliteral">&#39;/&#39;</span>; </div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="comment">// ... and finally a method to open a custom stream</span></div>
<div class="line">  IOStream* <a class="code" href="class_assimp_1_1_i_o_system.html#ac512ece3b0701de5682553007a4c0816" title="Open a new file with a given path.">Open</a>( <span class="keyword">const</span> std::string&amp; pFile, <span class="keyword">const</span> std::string&amp; pMode) {</div>
<div class="line">        <span class="keywordflow">return</span> <span class="keyword">new</span> MyIOStream( ... ); </div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="keywordtype">void</span> <a class="code" href="class_assimp_1_1_i_o_system.html#a8c334d60f04bceeb6bd0157d21723f3e" title="Closes the given file and releases all resources associated with it.">Close</a>( IOStream* pFile) { <span class="keyword">delete</span> pFile; }</div>
<div class="line">};</div>
</div><!-- fragment --><p>Now that your IO system is implemented, supply an instance of it to the Importer object by calling <a class="el" href="class_assimp_1_1_importer.html#a1161f46318af18bb86dfe0fc3edea4df" title="Supplies a custom IO handler to the importer to use to open and access files.">Assimp::Importer::SetIOHandler()</a>.</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> DoTheImportThing( <span class="keyword">const</span> std::string&amp; pFile)</div>
<div class="line">{</div>
<div class="line">  <a class="code" href="class_assimp_1_1_importer.html" title="CPP-API: The Importer class forms an C++ interface to the functionality of the Open Asset Import Libr...">Assimp::Importer</a> importer;</div>
<div class="line">  <span class="comment">// put my custom IO handling in place</span></div>
<div class="line">  importer.<a class="code" href="class_assimp_1_1_importer.html#a1161f46318af18bb86dfe0fc3edea4df" title="Supplies a custom IO handler to the importer to use to open and access files.">SetIOHandler</a>( <span class="keyword">new</span> MyIOSystem());</div>
<div class="line"></div>
<div class="line">  <span class="comment">// the import process will now use this implementation to access any file</span></div>
<div class="line">  importer.<a class="code" href="class_assimp_1_1_importer.html#a174418ab41d5b8bc51a044895cb991e5" title="Reads the given file and returns its contents if successful.">ReadFile</a>( pFile, SomeFlag | SomeOtherFlag);</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="custom_io_c"></a>
Using custom IO logic with the plain-c function interface</h1>
<p>The C interface also provides a way to override the file system. Control is not as fine-grained as for C++ although surely enough for almost any purpose. The process is simple:</p>
<ul>
<li>
Include <a class="el" href="cfileio_8h.html">cfileio.h</a> </li>
<li>
Fill an <a class="el" href="structai_file_i_o.html" title="C-API: File system callbacks.">aiFileIO</a> structure with custom file system callbacks (they're self-explanatory as they work similar to the CRT's fXXX functions) </li>
<li>
.. and pass it as parameter to <a class="el" href="cimport_8h.html#ae2b9815cac53dfcb2bf09aa9d8649894" title="Reads the given file using user-defined I/O functions and returns its content.">aiImportFileEx</a> </li>
</ul>
<h1><a class="anchor" id="logging"></a>
Logging</h1>
<p>The assimp library provides an easy mechanism to log messages. For instance if you want to check the state of your import and you just want to see, after which preprocessing step the import-process was aborted you can take a look into the log. Per default the assimp-library provides a default log implementation, where you can log your user specific message by calling it as a singleton with the requested logging-type. To see how this works take a look to this:</p>
<div class="fragment"><div class="line"><span class="keyword">using namespace </span>Assimp;</div>
<div class="line"></div>
<div class="line"><span class="comment">// Create a logger instance </span></div>
<div class="line"><a class="code" href="class_assimp_1_1_default_logger.html#adccb11f85f8b0ef226c382e11ba665c3" title="Creates a logging instance.">DefaultLogger::create</a>(<span class="stringliteral">&quot;&quot;</span>,<a class="code" href="class_assimp_1_1_logger.html#a8b6248a0fd062431e8572556350d29e6afc9d1d86aa82fdb80e00c99b3c1ce486" title="Debug infos will be logged, too.">Logger::VERBOSE</a>);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Now I am ready for logging my stuff</span></div>
<div class="line"><a class="code" href="class_assimp_1_1_default_logger.html#a7d0a53f2db66945ade30094330a77ba4" title="Getter for singleton instance.">DefaultLogger::get</a>()-&gt;<a class="code" href="class_assimp_1_1_logger.html#a12b8a125083c47ac0bb6056f00761e52" title="Writes a info message.">info</a>(<span class="stringliteral">&quot;this is my info-call&quot;</span>);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Kill it after the work is done</span></div>
<div class="line"><a class="code" href="class_assimp_1_1_default_logger.html#a0b1da096d7442af5a4a4cb5ebb2540f7" title="Kills the current singleton logger and replaces it with a #NullLogger instance.">DefaultLogger::kill</a>();</div>
</div><!-- fragment --><p>At first you have to create the default-logger-instance (create). Now you are ready to rock and can log a little bit around. After that you should kill it to release the singleton instance.</p>
<p>If you want to integrate the assimp-log into your own GUI it my be helpful to have a mechanism writing the logs into your own log windows. The logger interface provides this by implementing an interface called LogStream. You can attach and detach this log stream to the default-logger instance or any implementation derived from Logger. Just derivate your own logger from the abstract base class LogStream and overwrite the write-method:</p>
<div class="fragment"><div class="line"><span class="comment">// Example stream</span></div>
<div class="line"><span class="keyword">class </span>myStream :</div>
<div class="line">        <span class="keyword">public</span> LogStream</div>
<div class="line">{</div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line">        <span class="comment">// Constructor</span></div>
<div class="line">        myStream()</div>
<div class="line">        {</div>
<div class="line">                <span class="comment">// empty</span></div>
<div class="line">        }</div>
<div class="line">        </div>
<div class="line">        <span class="comment">// Destructor</span></div>
<div class="line">        ~myStream()</div>
<div class="line">        {</div>
<div class="line">                <span class="comment">// empty</span></div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="comment">// Write womethink using your own functionality</span></div>
<div class="line">        <span class="keywordtype">void</span> write(<span class="keyword">const</span> <span class="keywordtype">char</span>* message)</div>
<div class="line">        {</div>
<div class="line">                ::printf(<span class="stringliteral">&quot;%s\n&quot;</span>, message);</div>
<div class="line">        }</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">// Select the kinds of messages you want to receive on this log stream</span></div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> severity = Logger::DEBUGGING|Logger::INFO|Logger::ERR|Logger::WARN;</div>
<div class="line"></div>
<div class="line"><span class="comment">// Attaching it to the default logger</span></div>
<div class="line"><a class="code" href="class_assimp_1_1_default_logger.html#a7d0a53f2db66945ade30094330a77ba4" title="Getter for singleton instance.">Assimp::DefaultLogger::get</a>()-&gt;<a class="code" href="class_assimp_1_1_logger.html#aaf32a42b02a7e227076013d01e349871" title="Attach a new log-stream.">attachStream</a>( <span class="keyword">new</span> myStream(), severity );</div>
</div><!-- fragment --><p>The severity level controls the kind of message which will be written into the attached stream. If you just want to log errors and warnings set the warn and error severity flag for those severities. It is also possible to remove a self defined logstream from an error severity by detaching it with the severity flag set:</p>
<div class="fragment"><div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> severity = 0;</div>
<div class="line">severity |= Logger::DEBUGGING;</div>
<div class="line"></div>
<div class="line"><span class="comment">// Detach debug messages from you self defined stream</span></div>
<div class="line"><a class="code" href="class_assimp_1_1_default_logger.html#a7d0a53f2db66945ade30094330a77ba4" title="Getter for singleton instance.">Assimp::DefaultLogger::get</a>()-&gt;<a class="code" href="class_assimp_1_1_logger.html#aaf32a42b02a7e227076013d01e349871" title="Attach a new log-stream.">attachStream</a>( <span class="keyword">new</span> myStream(), severity );</div>
</div><!-- fragment --><p>If you want to implement your own logger just derive from the abstract base class #Logger and overwrite the methods debug, info, warn and error.</p>
<p>If you want to see the debug-messages in a debug-configured build, the Logger-interface provides a logging-severity. You can set it calling the following method:</p>
<div class="fragment"><div class="line"><a class="code" href="class_assimp_1_1_default_logger.html#a7d0a53f2db66945ade30094330a77ba4" title="Getter for singleton instance.">Assimp::DefaultLogger::get</a>()-&gt;<a class="code" href="class_assimp_1_1_logger.html#a8fb4fa4c2c329a36ac39bc9c743925f1" title="Set a new log severity.">setLogSeverity</a>( LogSeverity log_severity );</div>
</div><!-- fragment --><p>The normal logging severity supports just the basic stuff like, info, warnings and errors. In the verbose level very fine-grained debug messages will be logged, too. Note that this kind kind of logging might decrease import performance. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jul 10 2012 17:55:53 for Assimp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
